model{
  for (i in 1:n) {
    for (j in 1:m) {
      y[i, j] ~ dnorm(mu[i, j], inv.phi[j])
      mu[i, j] <- beta[j] * x[i]
    }
  }
  for (i in 1:n) {
    x[i] ~ dnorm(0, 100)
  }
  for (j in positive.items) {
    beta[j] ~ dnorm(0, 0.01) T(0,)
  }
  for (j in unconstrained.items) {
    beta[j] ~ dnorm(0, 0.01)
  }
  for (j in 1:m) {
    inv.phi[j] ~ dgamma(0.01, 0.01)
    phi[j] <- 1 / sqrt(inv.phi[j])
  }
}